/**
 * json配置举例，更多配置请看 IConfigSchema
 * @author luguoxiang
 * @date 2022/7/5
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
import { RadioGroup } from 'tdesign-vue-next';
import { IConfigSchema, LgBizSelect, LgBizSelectProps } from '@/soar';
import tenantApi from '@/pages/tenant/manage/api';
import UserSinglePicker from '@/pages/auth/user/Picker/SinglePicker.vue';

const fieldList: IConfigSchema<any>[] = [
  {
    field: 'tenantId',
    label: '租户',
    dataType: 'string',
    table: {
      colKey: 'tenantName',
    },
    search: {
      component: LgBizSelect,
      componentProps: {
        placeholder: '请选择${label}',
        data: tenantApi.query,
      } as LgBizSelectProps,
    },
    form: {
      component: LgBizSelect,
      componentProps: {
        placeholder: '请选择${label}',
        data: tenantApi.query,
      } as LgBizSelectProps,
    },
  },
  {
    field: 'realname',
    label: '姓名',
    dataType: 'string',
  },
  {
    field: 'userId',
    label: '账号',
    dataType: 'string',
    table: {
      colKey: 'username',
    },
    search: false,
    form: {
      component: UserSinglePicker,
      componentProps: {
        input: true,
      },
    },
  },
  {
    field: 'status',
    label: '状态',
    dataType: 'dict',
    params: 'TenantUserStatusEnum',
    form: {
      componentProps: {
        component: RadioGroup,
      },
    },
  },
];

export default fieldList;
